package logging;

import java.io.IOException;
import java.io.OutputStream;

/**
 * 不同的输出方式，只需要实现Appender接口做不同的实现即可，比如ConsoleAppender - 输出至控制台
 * @author Zhongzhicong
 * @date 2023/3/22 16:05
 * @version：1.0
 */
public class ConsoleAppender implements Appender {
    private OutputStream out = System.out;
    private OutputStream out_err = System.err;
    public String encoding = "UTF8";
    @Override
    public void append(LoggingEvent event) {
        try {
            out.write(event.toString().getBytes(encoding));
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
